import QtQuick 2.6
import QtQuick.LocalStorage 2.0
import Sailfish.Silica 1.0
import "pages"
import "./component"
import "./config"
import Nemo.Configuration 1.0
import com.novel.service 1.0

//QML页面的入口
ApplicationWindow {
    id:sailBookWidnow

    // 定义配置项路径（必须唯一）
    property string _configPath: "/apps/sailbook/settings"
    property int appThemeModeIndex: AppColor.themeModeIndex

    NovelService {
        id:novelService
    }


    //应用背景，若模式是跟随系统，则不显示
    Rectangle {
        id: windowBack
        anchors.fill: parent
        visible: AppColor.themeModeIndex!==2
        color: AppColor.themeMode.windowBackColor
        z:-1
    }


    //应用亮度
    Rectangle {
        id:windowBright
        anchors.fill: parent
        color: "black"
        opacity: 0.0 // 0（全亮）到1（全黑）间调整
        visible: isDimmed
    }

    //设置cover与启动页
    initialPage: Component { SplashPage { } }
     cover: Qt.resolvedUrl("cover/CoverPage.qml")

    //设置屏幕方向
    allowedOrientations: defaultAllowedOrientations

    //通知组件
    Notice {
        id: documentNotice
        duration: Notice.Long
    }

    //显示通知
    function showNotice(tips){
        documentNotice.text = tips;
        documentNotice.show();
    }
}
